<template>
  <div>
    <el-table
      :data="tableData"
      border
      style="width: 100%"
      :height="$store.state.app.tableHeight"
    >
      <el-table-column
        fixed
        prop="warehouseId"
        label="仓库编号"
      />
      <el-table-column
        prop="company"
        label="公司"
      />
      <el-table-column
        prop="desc"
        label="名称描述"
      />
      <el-table-column
        prop="address"
        label="地址"
      />
      <el-table-column
        prop="place"
        label="场所"
      />
      <el-table-column
        fixed="right"
        label="操作"
        width="100"
      >
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleClick(scope.row)">修改</el-button>
          <del-btn :title="'是否确认删除编号为' + scope.row.warehouseId + '的仓库？'" button-text="删除" @onConfirm="delWarehouseInfo(scope.row)" />
        </template>
      </el-table-column>
    </el-table>
    <warehouse-info-dialog ref="warehouseInfoForm" title="修改" />
  </div>
</template>

<script>
import warehouseInfoDialog from './warehouse-info-dialog'
import delBtn from '@/components/DelConfirm'
export default {
  components: {
    warehouseInfoDialog,
    delBtn
  },
  props: {
    tableData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      visible: false
    }
  },
  created() {
  },
  methods: {
    handleClick(row) {
      this.$refs.warehouseInfoForm.dialogAddNew = true
      console.log(row)
      this.$refs.warehouseInfoForm.form = row
    },
    delWarehouseInfo(row) {
      console.log('删除', row)
    }
  }
}
</script>

<style lang="sass" scoped>

</style>
